#include "chemnitz.h"
/*@-compdef@*/
#include "cyassl/ctaocrypt/aes.h"
/*@+compdef@*/

static char version [128];
static char *vers = "libchemnitz version 0";

static char *impl = "AES-128";

void chemnitz_encrypt (const uint8_t *plaintextblock, const uint8_t *key, const uint8_t *ciphertextblock)
{
	Aes ctx;

	memset ((void *) ciphertextblock, 0, 16);
	(void) AesSetKey (&ctx, key, 16, key, AES_ENCRYPTION);
	(void) AesCbcEncrypt (&ctx, (byte *) ciphertextblock, plaintextblock, 16);
}

void chemnitz_version (char **buffer)
{
	(void) snprintf (version, 128, "%s+%s", vers, impl);
	*buffer = version;
}

